import api from '@/api/api.js'

export default {
	state: {
		userInfo: {},
		userExams : {},
	},
	mutations: {
		setUserExams(state, userExams){
			state.userExams = userExams
		},
		setUserInfo(state, userInfo) {
			state.userInfo = userInfo	
		},
        getUserInfo(state) {
			return api('getUserInfo')
            .then(res => {
                if(res.code == 200){
                    state.userInfo = res.data.user
                }
            })
		},
	},
	getters: {
		userExams : state => state.userExams
	}
}